Debug Automation Code when it is not working as expected